<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Insurance Window</title>
    </head>
    <body>
        <table border="0">
            <tr>
                <td width="60">
                    旅客姓名:
                </td>
                <td>
                    <%=@passenger_name %>
                </td>
                <td width="60">
                    证件类型:
                </td>
                <td>
                    <%=@card_type %>
                </td>
                <td width="60">
                    证件号码:
                </td>
                <td>
                    <%=@card %>
                </td>
            </tr>
            <tr>
                <td colspan="6" scope="row">
                    <iframe id="isurance_win" name="isurance_win" src="https://epcis-agent.paic.com.cn/j_security_check?j_username=QDHJSWYXGS-00001&j_password=liutao666" scrolling="auto" width="800" height="500">
                    </iframe>
                </td>
            </tr>
        </table>
        <script>
            function setInsuranceFormValue(){
                debugger;
                //alert(document.frames[0]);
                var testframe = document.frames[0];
                //document.frames[framename].formname.控件id.value  
                //alert(document.isurance_win.document);//.getElementById("insuredName").value);
                //alert(document.isurance_win.document.inputForm.insuredName.value);
                //document.iframe名字.getElementById("你要获得的控件的名字").value
                //lert(window.frames['isurance_win'].document.inputForm);
                var testdom = $('isurance_win').contentWindow.document.getElementById('form');//forms[0];
                //alert($('isurance_win').document.inputForm);//.getElementsById('insuredName').value);
                //alert(document.frames[0].document.inputForm.elements["insuredName"].value);
                //document.frames[0].document.inputForm.elements["insuredName"].value='Mike';
            }
            
            function setInsuranceUrl(){
                //alert($('isurance_win').readyState);
                if ($('isurance_win').readyState == "complete") {
                    //alert('Ready!!!!!');
                    var url = "https://epcis-agent.paic.com.cn/agentApply.do?planCode=250";
                    document.frames[0].location.replace(url);
                    //$('isurance_win').src="";
                    //$('isurance_win').contentWindow.document.location.href = url;
                }
                else {
                    setTimeout("setInsuranceUrl()", 1000);
                }
            }
            
            setInsuranceUrl();
            function getIframeValue(){
                //            $('isurance_win').onreadystatechange = function(){
                //                alert('complete ');
                //                if (this.readyState == 'complete ') {
                //                    alert('complete ');
                //                }
                //                
                //            }
                //            alert($('isurance_win').readyState);
            
                //alert($('isurance_win').src);
                //alert($('isurance_win').readyState);
                //$('isurance_win').onreadystatechange = function(){
                //    if (this.readyState == 'complete ') 
                //alert('complete ');
                //        Ext.MessageBox.alert("订单", "您点击的订单编号为：");
                //}
                //alert($('isurance_win').contentWindow.document.location.href);
                //$('isurance_win').contentWindow.document.location.href="https://epcis-agent.paic.com.cn/agentApply.do?planCode=250";
            }
        </script>
    </body>
</html>
